from django.template import Library
from django.conf import settings

register = Library()


@register.inclusion_tag('static_menu.html')
def static_menu(request):
    """静态菜单"""
    menu_list = dict(menu_list=False)

    roles = request.user.roles.all()
    if roles:
        if roles[0].name in settings.ROLE_LIST:
            return menu_list

    menu_list['menu_list'] = True
    return menu_list

